home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD7501772000.psc / Version 1.0 / Config.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-07-07  |  10.2 KB  |  330 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmConfig 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Matrix Configuration"
  6.    ClientHeight    =   4740
  7.    ClientLeft      =   1305
  8.    ClientTop       =   2370
  9.    ClientWidth     =   7800
  10.    BeginProperty Font 
  11.       Name            =   "Tahoma"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   400
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    Icon            =   "Config.frx":0000
  20.    LinkTopic       =   "Form1"
  21.    MaxButton       =   0   'False
  22.    MinButton       =   0   'False
  23.    ScaleHeight     =   316
  24.    ScaleMode       =   3  'Pixel
  25.    ScaleWidth      =   520
  26.    ShowInTaskbar   =   0   'False
  27.    StartUpPosition =   2  'CenterScreen
  28.    Begin VB.CommandButton cmdAction 
  29.       Caption         =   "Cha&nge..."
  30.       Height          =   330
  31.       Index           =   3
  32.       Left            =   4995
  33.       TabIndex        =   16
  34.       Top             =   1530
  35.       Width           =   1140
  36.    End
  37.    Begin VB.TextBox txtFont 
  38.       Height          =   285
  39.       Left            =   3240
  40.       Locked          =   -1  'True
  41.       TabIndex        =   15
  42.       Top             =   1215
  43.       Width           =   2895
  44.    End
  45.    Begin VB.PictureBox picPreview 
  46.       BorderStyle     =   0  'None
  47.       Enabled         =   0   'False
  48.       Height          =   1680
  49.       Left            =   3570
  50.       ScaleHeight     =   112
  51.       ScaleMode       =   3  'Pixel
  52.       ScaleWidth      =   152
  53.       TabIndex        =   20
  54.       Top             =   2235
  55.       Width           =   2280
  56.    End
  57.    Begin MSComctlLib.Slider sldSpeed 
  58.       Height          =   420
  59.       Left            =   3240
  60.       TabIndex        =   13
  61.       Top             =   360
  62.       Width           =   2895
  63.       _ExtentX        =   5106
  64.       _ExtentY        =   741
  65.       _Version        =   393216
  66.       Min             =   1
  67.       Max             =   150
  68.       SelStart        =   75
  69.       TickFrequency   =   10
  70.       Value           =   75
  71.    End
  72.    Begin VB.Frame Frame2 
  73.       Caption         =   "Character Set:"
  74.       Height          =   1905
  75.       Left            =   180
  76.       TabIndex        =   7
  77.       Top             =   1980
  78.       Width           =   2895
  79.       Begin VB.TextBox txtChar 
  80.          Height          =   285
  81.          Left            =   540
  82.          TabIndex        =   11
  83.          Top             =   1350
  84.          Width           =   2040
  85.       End
  86.       Begin VB.OptionButton optChar 
  87.          Caption         =   "C&ustom"
  88.          Height          =   285
  89.          Index           =   2
  90.          Left            =   270
  91.          TabIndex        =   10
  92.          Top             =   1080
  93.          Width           =   1230
  94.       End
  95.       Begin VB.OptionButton optChar 
  96.          Caption         =   "&Binary"
  97.          Height          =   285
  98.          Index           =   1
  99.          Left            =   270
  100.          TabIndex        =   9
  101.          Top             =   720
  102.          Value           =   -1  'True
  103.          Width           =   1230
  104.       End
  105.       Begin VB.OptionButton optChar 
  106.          Caption         =   "&Complete"
  107.          Height          =   285
  108.          Index           =   0
  109.          Left            =   270
  110.          TabIndex        =   8
  111.          Top             =   360
  112.          Width           =   1230
  113.       End
  114.    End
  115.    Begin VB.Frame Frame1 
  116.       Caption         =   "Colours:"
  117.       Height          =   1770
  118.       Left            =   180
  119.       TabIndex        =   0
  120.       Top             =   135
  121.       Width           =   2895
  122.       Begin MatrixScr.asxColourSelect colSelect 
  123.          Height          =   330
  124.          Index           =   0
  125.          Left            =   1440
  126.          TabIndex        =   2
  127.          Top             =   315
  128.          Width           =   1140
  129.          _ExtentX        =   2011
  130.          _ExtentY        =   582
  131.          Colour          =   0
  132.       End
  133.       Begin MatrixScr.asxColourSelect colSelect 
  134.          Height          =   330
  135.          Index           =   1
  136.          Left            =   1440
  137.          TabIndex        =   4
  138.          Top             =   720
  139.          Width           =   1140
  140.          _ExtentX        =   2011
  141.          _ExtentY        =   582
  142.          Colour          =   65280
  143.       End
  144.       Begin MatrixScr.asxColourSelect colSelect 
  145.          Height          =   330
  146.          Index           =   2
  147.          Left            =   1440
  148.          TabIndex        =   6
  149.          Top             =   1125
  150.          Width           =   1140
  151.          _ExtentX        =   2011
  152.          _ExtentY        =   582
  153.          Colour          =   32768
  154.       End
  155.       Begin VB.Label lblHdr 
  156.          AutoSize        =   -1  'True
  157.          Caption         =   "&Dimmed Text:"
  158.          Height          =   195
  159.          Index           =   2
  160.          Left            =   270
  161.          TabIndex        =   5
  162.          Top             =   1170
  163.          Width           =   990
  164.       End
  165.       Begin VB.Label lblHdr 
  166.          AutoSize        =   -1  'True
  167.          Caption         =   "&Highlight Text:"
  168.          Height          =   195
  169.          Index           =   1
  170.          Left            =   270
  171.          TabIndex        =   3
  172.          Top             =   765
  173.          Width           =   1050
  174.       End
  175.       Begin VB.Label lblHdr 
  176.          AutoSize        =   -1  'True
  177.          Caption         =   "Back&ground:"
  178.          Height          =   195
  179.          Index           =   0
  180.          Left            =   270
  181.          TabIndex        =   1
  182.          Top             =   360
  183.          Width           =   900
  184.       End
  185.    End
  186.    Begin VB.CommandButton cmdAction 
  187.       Caption         =   "&About..."
  188.       Height          =   330
  189.       Index           =   2
  190.       Left            =   6480
  191.       TabIndex        =   19
  192.       Top             =   990
  193.       Width           =   1140
  194.    End
  195.    Begin VB.CommandButton cmdAction 
  196.       Cancel          =   -1  'True
  197.       Caption         =   "Cance&l"
  198.       Height          =   330
  199.       Index           =   1
  200.       Left            =   6480
  201.       TabIndex        =   18
  202.       Top             =   495
  203.       Width           =   1140
  204.    End
  205.    Begin VB.CommandButton cmdAction 
  206.       Caption         =   "OK"
  207.       Default         =   -1  'True
  208.       Height          =   330
  209.       Index           =   0
  210.       Left            =   6480
  211.       TabIndex        =   17
  212.       Top             =   135
  213.       Width           =   1140
  214.    End
  215.    Begin VB.Label lblHdr 
  216.       AutoSize        =   -1  'True
  217.       Caption         =   "&Font:"
  218.       Height          =   195
  219.       Index           =   4
  220.       Left            =   3240
  221.       TabIndex        =   14
  222.       Top             =   990
  223.       Width           =   390
  224.    End
  225.    Begin VB.Label lblHdr 
  226.       AutoSize        =   -1  'True
  227.       Caption         =   "&Speed:"
  228.       Height          =   195
  229.       Index           =   3
  230.       Left            =   3240
  231.       TabIndex        =   12
  232.       Top             =   135
  233.       Width           =   510
  234.    End
  235.    Begin VB.Image Image1 
  236.       Height          =   2535
  237.       Left            =   3330
  238.       Picture         =   "Config.frx":0442
  239.       Stretch         =   -1  'True
  240.       Top             =   1980
  241.       Width           =   2775
  242.    End
  243. Attribute VB_Name = "frmConfig"
  244. Attribute VB_GlobalNameSpace = False
  245. Attribute VB_Creatable = False
  246. Attribute VB_PredeclaredId = True
  247. Attribute VB_Exposed = False
  248. Option Explicit
  249. DefInt A-Z
  250. Private SaverForm As frmScreenSaver
  251. Private DispFont As StdFont
  252. Private Sub cmdAction_Click(Index As Integer)
  253.  Dim I
  254.  Dim TempFont As StdFont
  255.  Select Case Index
  256.   Case 0
  257.    'save settings and close
  258.    BackgroundClr = colSelect(0).Colour
  259.    HighlightTextClr = colSelect(1).Colour
  260.    DimmedTextClr = colSelect(2).Colour
  261.    Speed = sldSpeed.Value
  262.    For I = 0 To optChar.Count - 1
  263.     If optChar(I) Then
  264.      CharacterSet = I
  265.     End If
  266.    Next
  267.    SaveSetting "Matrix ScreenSaver", "Version 1.0", "BackgroundColour", BackgroundClr
  268.    SaveSetting "Matrix ScreenSaver", "Version 1.0", "HighlightTextColour", HighlightTextClr
  269.    SaveSetting "Matrix ScreenSaver", "Version 1.0", "DimmedTextColour", DimmedTextClr
  270.    SaveSetting "Matrix ScreenSaver", "Version 1.0", "Speed", Speed
  271.    SaveSetting "Matrix ScreenSaver", "Version 1.0", "CharacterSet", CharacterSet
  272.    SaveSetting "Matrix ScreenSaver", "Version 1.0", "CharacterSetChar", CharacterSetChar
  273.    SaveSetting "Matrix ScreenSaver", "Version 1.0", "Font", FontData$
  274.    Unload Me
  275.   Case 1: Unload Me
  276.   Case 2: About
  277.   Case 3
  278.    'change font
  279.    Set TempFont = StringToFont(FontData$)
  280.    If SelectFont(hWnd, TempFont) Then
  281.     FontData$ = FontToString(TempFont)
  282.     Set SaverForm.Font = StringToFont(FontData$)
  283.     SaverForm.UpdateFont
  284.     Set DispFont = StringToFont(FontData$)
  285.     txtFont = DispFont.Size & "pt " & DispFont.Name
  286.    End If
  287.  End Select
  288. End Sub
  289. Private Sub colSelect_Change(Index As Integer, Color As stdole.OLE_COLOR)
  290.  Select Case Index
  291.   Case 0
  292.    BackgroundClr = Color
  293.    SaverForm.BackColor = Color
  294.   Case 1: HighlightTextClr = Color
  295.   Case 2: DimmedTextClr = Color
  296.  End Select
  297. End Sub
  298. Private Sub Form_Load()
  299.  'create preview saver form
  300.  Set SaverForm = New frmScreenSaver
  301.  'set values
  302.  colSelect(0).Colour = BackgroundClr
  303.  colSelect(1).Colour = HighlightTextClr
  304.  colSelect(2).Colour = DimmedTextClr
  305.  sldSpeed.Value = Speed
  306.  optChar(CharacterSet) = -1
  307.  txtChar = CharacterSetChar$
  308.  Set DispFont = StringToFont(FontData$)
  309.  txtFont = DispFont.Size & "pt " & DispFont.Name
  310.  'show preview (cool!)
  311.  PreviewSaver SaverForm, picPreview.hWnd
  312. End Sub
  313. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  314.  Unload SaverForm
  315.  Set SaverForm = Nothing
  316. End Sub
  317. Private Sub optChar_Click(Index As Integer)
  318.  CharacterSet = Index
  319. End Sub
  320. Private Sub sldSpeed_Change()
  321.  Speed = sldSpeed
  322.  SaverForm.tmrUpdate.Interval = sldSpeed
  323. End Sub
  324. Private Sub sldSpeed_Scroll()
  325.  sldSpeed_Change
  326. End Sub
  327. Private Sub txtChar_Change()
  328.  CharacterSetChar = txtChar
  329. End Sub
  330.